package com.helmlabs.grouper.accounts.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.helmlabs.grouper.accounts.model.Role;

public class RoleDaoHibernate extends HibernateDaoSupport implements RoleDao {

	public Role get(Long id) {
		return (Role)getHibernateTemplate().get(Role.class, id);
	}

	public Role save(Role role) {
		
		if (role!=null && role.getId()==null){
			Long id = (Long)getHibernateTemplate().save(role);
			role.setId(id);
		} else if (role!=null && role.getId()!=null){
			getHibernateTemplate().save(role);
		}
		return role;
	}

	public List<Role> getAllActiveByUserId(Long userid) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Role> getAllRolesByTypeAndParent(String type, Long parentid) {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean activateObjectInRole(String roleType, Long objectId,
			Long roleId) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean deactivateObjectInRole(String roleType, Long objectId,
			Long roleId) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isObjectInRole(String roleType, Long objectId, Long roleId) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isObjectInRoleRecursive(String roleType, Long objectId,
			Long roleId) {
		// TODO Auto-generated method stub
		return false;
	}

	public List<Role> getActiveRolesForObject(String roleType, Long objectId) {
		// TODO Auto-generated method stub
		return null;
	}
	
	

}
